package cn.tedu.innerclass;
/*用于测试匿名内部类
* 通常与匿名对象结合在一起使用*/
public class TestInner5 {
    public static void main(String[] args) {
        /*三效合一*/
        new Inter1() {
            @Override
            public void save() {
                System.out.println("保存");
            }

            @Override
            public void get() {

            }
        }.save();
        new Inter2() {
            @Override
            public void drink() {
                System.out.println("我难在么我喝不到酒");
            }
        }.drink();
        new Inter3().powerUp();
        new Inter3().study();
    }
}
interface Inter1{
    void save();
    void get();
}
class InterImpl implements Inter1{

    @Override
    public void save() {
        System.out.println();
    }

    @Override
    public void get() {

    }
}
abstract class Inter2{
    public void play(){
        System.out.println("玩代码");
    }
    abstract public void drink();
}
class Inter3{
    public void study(){
        System.out.println("无心学习,只想搞钱");
    }
    public void powerUp(){
        System.out.println("我们会越来越强的");
    }
}